home *** CD-ROM | disk | FTP | other *** search
- Path: news.gate.net!news-adm
- From: "Mark W. Alexander" <mwa@gate.net>
- Newsgroups: comp.lang.c
- Subject: Re: What to do when feof() is NOT feof()
- Date: Fri, 23 Feb 1996 21:41:17 -0500
- Organization: CyberGate, Inc.
- Message-ID: <312E7ACD.60CF@gate.net>
- References: <4g7rsj$fnf@spectator.cris.com> <1996Feb19.063026.29889@zcon.com> <4gb7r3$p4k@sun001.spd.dsccc.com> <4gj6bg$mrv@solutions.solon.com>
- NNTP-Posting-Host: hopi.gate.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Peter and Mike wrote stuff debating ethics, but I missed the technical details that started it
- and have a problem that seems related to the subject...
-
- I'm trying to monitor a log file while a process is running by piping tail -f into a C program
- (Solaris 2.4, if it matters). Everything works wonderfull...until...I have a remote shell that
- passes exception information to our trouble ticketing system so that the appriopriate (as in not
- me!) people can be awakened at unpleasent hours. Shortly, (not immediately) after calling
- system(remote_shell_command) the third or fourth time (abitrary as far as I can tell): feof()
- becomes true, ferror() is false, and perror() says Interrupted system call (errno=4). In other
- words:
-
- feof() != feof()
-
- My humble question is: What the ???? I can't clear the error. I can't rewind(stdin). I can't exec
- another copy to reinitialize everything. What can I do?
-
- For what it's worth, I also tried this in awk. awk simply stopped (again, a few lines) after the
- system() command. In both cases commenting out the system() call prevents the problem. It seems
- I'm missing something fundamental here with the pipe coming in and then passing out to another
- shell. If I need a whack up side the head, please feel free. I'll take anything at this point!
-
- TIA,
- Mark
-